//绑定每个button
var btnIndex = document.getElementById("information");
var btnTree = document.getElementById("missionTree");
var btnMis = document.getElementById("missionHub");
var c1 = document.getElementById("containerIndex");
var c2 = document.getElementById("containerTree");
var c3 = document.getElementById("containerMission");
btnIndex.onclick = function(){
    c1.style.display = "block";
    c2.style.display = "none";
    c3.style.display = "none";
}
btnTree.onclick = function(){
    c1.style.display = "none";
    c2.style.display = "block";
    c3.style.display = "none";
}
btnMis.onclick = function(){
    c1.style.display = "none";
    c2.style.display = "none";
    c3.style.display = "block";
}

//任务按钮绑定
var missionR = document.getElementById("missionRev");
var missionP = document.getElementById("missionPub");
var hid = document.getElementsByClassName("hid");
var icon = document.getElementsByClassName("fa-chevron-right");
missionR.onclick = function(){
    if(hid[0].style.display =="block"){
        hid[0].style.display = "none";
        icon[0].style.transform = 'rotate(0deg)';
    } else {
        hid[0].style.display = "block";
        icon[0].style.transform = 'rotate(90deg)';
    }
}
missionP.onclick = function(){
    if(hid[1].style.display =="block"){
        hid[1].style.display = "none";
        icon[1].style.transform = 'rotate(0deg)';
    } else {
        hid[1].style.display = "block";
        icon[1].style.transform = 'rotate(90deg)';
    }
}
//运行函数
changeInformation("牛梓雨","天津工业大学","管理学院","60","100");

/*弹出窗口*/
var hid1 = document.getElementById("hid1");
var hid2 = document.getElementById("hid2");
var missions = hid1.getElementsByClassName("missions");
var missions2 = hid2.getElementsByClassName("missions");
var elasticFrame = document.getElementById("elasticFrame");
var elasticFrame2 = document.getElementById("elasticFrame2");
var show = elasticFrame.getElementsByClassName("mission")[0];
var show2 = elasticFrame2.getElementsByClassName("mission")[0];
var closeBtn = document.getElementById("closeBtn");
var closeBtn2 = document.getElementById("closeBtn2");
closeBtn.onclick = function(){
    elasticFrame.style.display = "none";
    document.body.style.overflow = "";
    show.removeChild(show.lastChild);

}
closeBtn2.onclick = function(){
    elasticFrame2.style.display = "none";
    document.body.style.overflow = "";
    show2.removeChild(show2.lastChild);

}